'use strict'
class Route {
    constructor() {
        this.notLogin = {} //用户不需要登录的请求路由
        this.login = {} //用户登录后的请求路由
        this.nodeMap = {} //子节点请求路由
        this.errMap = {} //用于错误提示
    }
    setNotLogin(routeName, func, err) {
        this.notLogin[routeName] = func

        if (err) {
            this.errMap[routeName] = err
        }
    }

    getNotLogin(routeName) {
        return this.notLogin[routeName]
    }

    set(routeName, func, err) {
        this.login[routeName] = func
        if (err) {
            this.errMap[routeName] = err
        }
    }

    getLogin(routeName) {
        return this.login[routeName]
    }

    setNode(routeName, nodeType) {
        this.nodeMap[routeName] = nodeType
    }

    getNodeType(routeName) {
        return this.nodeMap[routeName]
    }
}
let route = new Route()
module.exports = route
